package StudyCode.summary.mycollection;

import java.util.ArrayList;
import java.util.Iterator;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class UsingAnIteratorToIterateAllElementsInAnArrayList {
	public static void main(String[] args) {

		ArrayList<String> nums = new ArrayList<String>();
		nums.add("One");
		nums.add("Two");
		nums.add("Three");
		nums.add("Four");

		String s;
		Iterator e = nums.iterator();
		while (e.hasNext()) {
			s = (String) e.next();
			System.out.println(s);
		}

	}
}
